
/******************************************************************************\
|    Title:        	 FIGUREF8: Placebo Analysis for the Effect of Switching on |
|						lobbying revenue									   |
|    Date:         	 July 2023	                                         	   |
|    Author:         Elisa Wirsching	      							       |
\******************************************************************************/


clear all
set more off, permanently
numlabel, add
set maxvar 32000


use lobbyist_yearly.dta, clear	

* regression
reg log_adjlobrev_wgt i.switcher##i.yearsinceleaving experience_imp daysworked committeestaff_everyear personalstaff_everyear senate_everyear majority_everyear minority_everyear dcoffice_everyear leaderofficestaff_everyear log_max_adjannual_pay i.year if posttreat==0, cluster(stafferid)

* plot marginal effects
margins if yearsinceleaving<6, dydx(i.switcher) over(i.yearsinceleaving)

marginsplot, plotopts(connect(none) mcolor(black) lcolor(black)) graphregion(color(white)) yline(0, lcolor(black)) recastci(rspike) ciopts(lcolor(black)) ytitle("Effect estimate for being a switcher") title("") xtitle("Year since leaving Congress")